/*
 * Copyright 2018 JDCLOUD.COM
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http:#www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * JCLOUD MONITOR API
 * monitor API
 *
 * OpenAPI spec version: v2
 * Contact: 
 *
 * NOTE: This class is auto generated by the jdcloud code generator program.
 */


using JDCloudSDK.Core.Auth;
using JDCloudSDK.Core.Client;
using JDCloudSDK.Core.Http;
using JDCloudSDK.Monitor.Apis;
using JDCloudSDK.Monitor.Model;
using System;
using System.Collections.Generic;
using System.Text;
#if NET40||NET35
#else
using System.Threading.Tasks;
#endif

namespace JDCloudSDK.Monitor.Client
{
    /// <summary>
    ///  JCLOUD MONITOR API
    ///  monitor API
    ///  Monitor Api 客户端
    ///</summary>
    public class MonitorClient : JdcloudClient
    {

        /// <summary>
        ///  默认私有构造函数
        /// </summary>
        private MonitorClient()
        {

        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="environment">sdk 环境配置信息</param>
        public MonitorClient(CredentialsProvider credentialsProvider, HttpRequestConfig httpRequestConfig,SDKEnvironment environment)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
            this.environment = environment;
        }

        /// <summary>
        /// 默认构造函数
        /// </summary>
        /// <param name="httpRequestConfig">http 客户端配置信息</param>
        /// <param name="credentialsProvider">认证信息</param>
        public MonitorClient(CredentialsProvider credentialsProvider,HttpRequestConfig httpRequestConfig)
        {
            this.httpRequestConfig = httpRequestConfig;
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        /// 默认构造函数，
        /// 注意如果使用此方法 httpRequestConfig 使用的http 请求 schema 为Https
        /// </summary>
        /// <param name="credentialsProvider">认证信息</param>
        public MonitorClient(CredentialsProvider credentialsProvider)
        {
            this.credentialsProvider = credentialsProvider;
        }

        /// <summary>
        ///  版本号 1.2.3
        ///</summary>
        public const string ClientVersion = "1.2.3";

        private const string apiVersion = "v2";
        private const string userAgentPrefix = "JdcloudSdkDotNet";
        private const string defaultEndpoint = "monitor.jdcloud-api.com";
        private const string serviceName = "monitor";
        private const string userAgent = userAgentPrefix + "/" + ClientVersion + " " + serviceName + "/" + apiVersion;


        private SDKEnvironment environment = new SDKEnvironment(defaultEndpoint);
        private CredentialsProvider credentialsProvider;
        private HttpRequestConfig httpRequestConfig;

        /// <summary>
        ///  获取证书信息
        ///</summary>
        public override CredentialsProvider CredentialsProvider   { get { return credentialsProvider; } }

        /// <summary>
        ///  获取http 客户端配置信息
        ///</summary>
        public override HttpRequestConfig HttpRequestConfig { get { return httpRequestConfig; } }

        /// <summary>
        ///  获取sdk环境配置信息
        ///</summary>
        public override SDKEnvironment SDKEnvironment { get { return environment; } }

        /// <summary>
        ///  获取用户自定义浏览器识别字符串
        ///</summary>
        public override string UserAgent { get { return userAgent; } }

        /// <summary>
        ///  获取服务名称
        ///</summary>
        public override string ServiceName { get { return serviceName; } }

        /// <summary>
        ///  获取版本号
        ///</summary>
        public override string Version { get { return apiVersion; } }



#if NET40||NET35
        /// <summary>
        ///  创建报警规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public CreateAlarmResponse CreateAlarm(CreateAlarmRequest request) {
            return  new CreateAlarmExecutor().Client(this).Execute<CreateAlarmResponse, CreateAlarmResult, CreateAlarmRequest>(request);
        }
#else
        /// <summary>
        ///  创建报警规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<CreateAlarmResponse> CreateAlarm(CreateAlarmRequest request) {
            return await new CreateAlarmExecutor().Client(this).Execute<CreateAlarmResponse, CreateAlarmResult, CreateAlarmRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查看某资源单个监控项数据，metric介绍：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;Metrics&lt;/a&gt;，可以使用接口&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;describeMetrics&lt;/a&gt;：查询产品线可用的metric列表。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeMetricDataResponse DescribeMetricData(DescribeMetricDataRequest request) {
            return  new DescribeMetricDataExecutor().Client(this).Execute<DescribeMetricDataResponse, DescribeMetricDataResult, DescribeMetricDataRequest>(request);
        }
#else
        /// <summary>
        ///  查看某资源单个监控项数据，metric介绍：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;Metrics&lt;/a&gt;，可以使用接口&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;describeMetrics&lt;/a&gt;：查询产品线可用的metric列表。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeMetricDataResponse> DescribeMetricData(DescribeMetricDataRequest request) {
            return await new DescribeMetricDataExecutor().Client(this).Execute<DescribeMetricDataResponse, DescribeMetricDataResult, DescribeMetricDataRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询监控图可用的产品线列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeServicesResponse DescribeServices(DescribeServicesRequest request) {
            return  new DescribeServicesExecutor().Client(this).Execute<DescribeServicesResponse, DescribeServicesResult, DescribeServicesRequest>(request);
        }
#else
        /// <summary>
        ///  查询监控图可用的产品线列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeServicesResponse> DescribeServices(DescribeServicesRequest request) {
            return await new DescribeServicesExecutor().Client(this).Execute<DescribeServicesResponse, DescribeServicesResult, DescribeServicesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询可用于创建监控规则的指标列表,metric介绍：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;Metrics&lt;/a&gt;
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeMetricsForAlarmResponse DescribeMetricsForAlarm(DescribeMetricsForAlarmRequest request) {
            return  new DescribeMetricsForAlarmExecutor().Client(this).Execute<DescribeMetricsForAlarmResponse, DescribeMetricsForAlarmResult, DescribeMetricsForAlarmRequest>(request);
        }
#else
        /// <summary>
        ///  查询可用于创建监控规则的指标列表,metric介绍：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;Metrics&lt;/a&gt;
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeMetricsForAlarmResponse> DescribeMetricsForAlarm(DescribeMetricsForAlarmRequest request) {
            return await new DescribeMetricsForAlarmExecutor().Client(this).Execute<DescribeMetricsForAlarmResponse, DescribeMetricsForAlarmResult, DescribeMetricsForAlarmRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询规则的报警联系人
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAlarmContactsResponse DescribeAlarmContacts(DescribeAlarmContactsRequest request) {
            return  new DescribeAlarmContactsExecutor().Client(this).Execute<DescribeAlarmContactsResponse, DescribeAlarmContactsResult, DescribeAlarmContactsRequest>(request);
        }
#else
        /// <summary>
        ///  查询规则的报警联系人
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAlarmContactsResponse> DescribeAlarmContacts(DescribeAlarmContactsRequest request) {
            return await new DescribeAlarmContactsExecutor().Client(this).Execute<DescribeAlarmContactsResponse, DescribeAlarmContactsResult, DescribeAlarmContactsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询报警历史
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAlarmHistoryResponse DescribeAlarmHistory(DescribeAlarmHistoryRequest request) {
            return  new DescribeAlarmHistoryExecutor().Client(this).Execute<DescribeAlarmHistoryResponse, DescribeAlarmHistoryResult, DescribeAlarmHistoryRequest>(request);
        }
#else
        /// <summary>
        ///  查询报警历史
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAlarmHistoryResponse> DescribeAlarmHistory(DescribeAlarmHistoryRequest request) {
            return await new DescribeAlarmHistoryExecutor().Client(this).Execute<DescribeAlarmHistoryResponse, DescribeAlarmHistoryResult, DescribeAlarmHistoryRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询规则详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAlarmResponse DescribeAlarm(DescribeAlarmRequest request) {
            return  new DescribeAlarmExecutor().Client(this).Execute<DescribeAlarmResponse, DescribeAlarmResult, DescribeAlarmRequest>(request);
        }
#else
        /// <summary>
        ///  查询规则详情
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAlarmResponse> DescribeAlarm(DescribeAlarmRequest request) {
            return await new DescribeAlarmExecutor().Client(this).Execute<DescribeAlarmResponse, DescribeAlarmResult, DescribeAlarmRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  删除规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DeleteAlarmsResponse DeleteAlarms(DeleteAlarmsRequest request) {
            return  new DeleteAlarmsExecutor().Client(this).Execute<DeleteAlarmsResponse, DeleteAlarmsResult, DeleteAlarmsRequest>(request);
        }
#else
        /// <summary>
        ///  删除规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DeleteAlarmsResponse> DeleteAlarms(DeleteAlarmsRequest request) {
            return await new DeleteAlarmsExecutor().Client(this).Execute<DeleteAlarmsResponse, DeleteAlarmsResult, DeleteAlarmsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  根据不同的聚合方式将metric的数据聚合为一个点。downAggrType：last(最后一个点)、max(最大值)、min(最小值)、avg(平均值)。该接口返回值为上报metric的原始值，没有做单位转换。metric介绍：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;Metrics&lt;/a&gt;
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public LastDownsampleResponse LastDownsample(LastDownsampleRequest request) {
            return  new LastDownsampleExecutor().Client(this).Execute<LastDownsampleResponse, LastDownsampleResult, LastDownsampleRequest>(request);
        }
#else
        /// <summary>
        ///  根据不同的聚合方式将metric的数据聚合为一个点。downAggrType：last(最后一个点)、max(最大值)、min(最小值)、avg(平均值)。该接口返回值为上报metric的原始值，没有做单位转换。metric介绍：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;Metrics&lt;/a&gt;
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<LastDownsampleResponse> LastDownsample(LastDownsampleRequest request) {
            return await new LastDownsampleExecutor().Client(this).Execute<LastDownsampleResponse, LastDownsampleResult, LastDownsampleRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询可用于创建监控规则的产品列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeProductsForAlarmResponse DescribeProductsForAlarm(DescribeProductsForAlarmRequest request) {
            return  new DescribeProductsForAlarmExecutor().Client(this).Execute<DescribeProductsForAlarmResponse, DescribeProductsForAlarmResult, DescribeProductsForAlarmRequest>(request);
        }
#else
        /// <summary>
        ///  查询可用于创建监控规则的产品列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeProductsForAlarmResponse> DescribeProductsForAlarm(DescribeProductsForAlarmRequest request) {
            return await new DescribeProductsForAlarmExecutor().Client(this).Execute<DescribeProductsForAlarmResponse, DescribeProductsForAlarmResult, DescribeProductsForAlarmRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  修改已创建的报警规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public UpdateAlarmResponse UpdateAlarm(UpdateAlarmRequest request) {
            return  new UpdateAlarmExecutor().Client(this).Execute<UpdateAlarmResponse, UpdateAlarmResult, UpdateAlarmRequest>(request);
        }
#else
        /// <summary>
        ///  修改已创建的报警规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<UpdateAlarmResponse> UpdateAlarm(UpdateAlarmRequest request) {
            return await new UpdateAlarmExecutor().Client(this).Execute<UpdateAlarmResponse, UpdateAlarmResult, UpdateAlarmRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  通过指定维度查询自定义监控的数据
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeCustomMetricDataResponse DescribeCustomMetricData(DescribeCustomMetricDataRequest request) {
            return  new DescribeCustomMetricDataExecutor().Client(this).Execute<DescribeCustomMetricDataResponse, DescribeCustomMetricDataResult, DescribeCustomMetricDataRequest>(request);
        }
#else
        /// <summary>
        ///  通过指定维度查询自定义监控的数据
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeCustomMetricDataResponse> DescribeCustomMetricData(DescribeCustomMetricDataRequest request) {
            return await new DescribeCustomMetricDataExecutor().Client(this).Execute<DescribeCustomMetricDataResponse, DescribeCustomMetricDataResult, DescribeCustomMetricDataRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  启用、禁用规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public EnableAlarmsResponse EnableAlarms(EnableAlarmsRequest request) {
            return  new EnableAlarmsExecutor().Client(this).Execute<EnableAlarmsResponse, EnableAlarmsResult, EnableAlarmsRequest>(request);
        }
#else
        /// <summary>
        ///  启用、禁用规则
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<EnableAlarmsResponse> EnableAlarms(EnableAlarmsRequest request) {
            return await new EnableAlarmsExecutor().Client(this).Execute<EnableAlarmsResponse, EnableAlarmsResult, EnableAlarmsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询某资源下指定tag key的tag value
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeTagValuesResponse DescribeTagValues(DescribeTagValuesRequest request) {
            return  new DescribeTagValuesExecutor().Client(this).Execute<DescribeTagValuesResponse, DescribeTagValuesResult, DescribeTagValuesRequest>(request);
        }
#else
        /// <summary>
        ///  查询某资源下指定tag key的tag value
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeTagValuesResponse> DescribeTagValues(DescribeTagValuesRequest request) {
            return await new DescribeTagValuesExecutor().Client(this).Execute<DescribeTagValuesResponse, DescribeTagValuesResult, DescribeTagValuesRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  该接口为自定义监控数据上报的接口，方便您将自己采集的时序数据上报到云监控。不同region域名上报不同region的数据，参考：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/reporting-monitoring-data&quot;&gt;调用说明&lt;/a&gt;可上报原始数据和已聚合的统计数据。支持批量上报方式。单次请求最多包含 50 个数据点；数据大小不超过 256k。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public PutCustomMetricDataResponse PutCustomMetricData(PutCustomMetricDataRequest request) {
            return  new PutCustomMetricDataExecutor().Client(this).Execute<PutCustomMetricDataResponse, PutCustomMetricDataResult, PutCustomMetricDataRequest>(request);
        }
#else
        /// <summary>
        ///  该接口为自定义监控数据上报的接口，方便您将自己采集的时序数据上报到云监控。不同region域名上报不同region的数据，参考：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/reporting-monitoring-data&quot;&gt;调用说明&lt;/a&gt;可上报原始数据和已聚合的统计数据。支持批量上报方式。单次请求最多包含 50 个数据点；数据大小不超过 256k。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<PutCustomMetricDataResponse> PutCustomMetricData(PutCustomMetricDataRequest request) {
            return await new PutCustomMetricDataExecutor().Client(this).Execute<PutCustomMetricDataResponse, PutCustomMetricDataResult, PutCustomMetricDataRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  该接口为自定义监控数据上报的接口，方便您将自己采集的时序数据上报到云监控。不同region域名上报不同region的数据，参考：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/reporting-monitoring-data&quot;&gt;调用说明&lt;/a&gt;可上报原始数据和已聚合的统计数据。支持批量上报方式。单次请求最多包含 50 个数据点；数据大小不超过 256k。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public PutMetricDataResponse PutMetricData(PutMetricDataRequest request) {
            return  new PutMetricDataExecutor().Client(this).Execute<PutMetricDataResponse, PutMetricDataResult, PutMetricDataRequest>(request);
        }
#else
        /// <summary>
        ///  该接口为自定义监控数据上报的接口，方便您将自己采集的时序数据上报到云监控。不同region域名上报不同region的数据，参考：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/reporting-monitoring-data&quot;&gt;调用说明&lt;/a&gt;可上报原始数据和已聚合的统计数据。支持批量上报方式。单次请求最多包含 50 个数据点；数据大小不超过 256k。
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<PutMetricDataResponse> PutMetricData(PutMetricDataRequest request) {
            return await new PutMetricDataExecutor().Client(this).Execute<PutMetricDataResponse, PutMetricDataResult, PutMetricDataRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  查询规则列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeAlarmsResponse DescribeAlarms(DescribeAlarmsRequest request) {
            return  new DescribeAlarmsExecutor().Client(this).Execute<DescribeAlarmsResponse, DescribeAlarmsResult, DescribeAlarmsRequest>(request);
        }
#else
        /// <summary>
        ///  查询规则列表
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeAlarmsResponse> DescribeAlarms(DescribeAlarmsRequest request) {
            return await new DescribeAlarmsExecutor().Client(this).Execute<DescribeAlarmsResponse, DescribeAlarmsResult, DescribeAlarmsRequest>(request).ConfigureAwait(false);
        }
#endif
#if NET40||NET35
        /// <summary>
        ///  根据产品线查询可用监控项列表,metric介绍：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;Metrics&lt;/a&gt;
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public DescribeMetricsResponse DescribeMetrics(DescribeMetricsRequest request) {
            return  new DescribeMetricsExecutor().Client(this).Execute<DescribeMetricsResponse, DescribeMetricsResult, DescribeMetricsRequest>(request);
        }
#else
        /// <summary>
        ///  根据产品线查询可用监控项列表,metric介绍：&lt;a href&#x3D;&quot;https://docs.jdcloud.com/cn/monitoring/metrics&quot;&gt;Metrics&lt;/a&gt;
        /// </summary>
        /// <param name="request">请求参数信息</param>
        /// <returns>请求结果信息</returns>
        public async Task<DescribeMetricsResponse> DescribeMetrics(DescribeMetricsRequest request) {
            return await new DescribeMetricsExecutor().Client(this).Execute<DescribeMetricsResponse, DescribeMetricsResult, DescribeMetricsRequest>(request).ConfigureAwait(false);
        }
#endif

            /// <summary>
            ///  默认MonitorClient 构造器 接口
            ///</summary>
            public interface Builder
            {

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>monitorClient 构造器</returns>
                Builder CredentialsProvider(CredentialsProvider provider);

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>monitorClient 构造器</returns>
                Builder Environment(Core.Client.SDKEnvironment environment);

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>monitorClient 构造器</returns>
                Builder HttpRequestConfig(HttpRequestConfig config);

                /// <summary>
                ///  构造MonitorClient 对象
                ///</summary>
                MonitorClient Build();
            }

            /// <summary>
            ///  默认MonitorClient 构造器
            ///</summary>
            public class DefaultBuilder : Builder
            {
                /// <summary>
                ///  MonitorClient service client
                /// </summary>
                private  MonitorClient monitorClient;

                /// <summary>
                ///  默认MonitorClient 构造器构造对象
                ///</summary>
                public DefaultBuilder()
                {
                    monitorClient = new MonitorClient();
                }

                /// <summary>
                ///  构造MonitorClient 对象
                ///</summary>
                public MonitorClient Build()
                {
                    if (monitorClient.CredentialsProvider == null)
                    {
                        //if credentialsProvider not set, try load jdcloud global default  credentials provider
                        monitorClient.credentialsProvider = JdCloud.DefaultInstance.GetCredentialsProvider();
                        if (monitorClient.credentialsProvider == null)
                        {
                            throw new ArgumentNullException("MonitorClient build error: jdcloud credentials provider not set");
                        }
                    }
                    if (monitorClient.HttpRequestConfig == null)
                    {
                        monitorClient.httpRequestConfig = JdCloud.DefaultInstance.GetHttpRequestConfig();
                        if (monitorClient.httpRequestConfig == null)
                        {
                        throw new ArgumentNullException("MonitorClient build error: http request config not set");
                        }
                    }
                    return monitorClient;
                }

                /// <summary>
                /// 设置认证信息参数
                /// </summary>
                /// <param name="provider">认证信息提供对象</param>
                /// <returns>monitorClient 构造器</returns>
                public Builder CredentialsProvider(CredentialsProvider provider)
                {
                    monitorClient.credentialsProvider = provider;
                    return this;
                }

                /// <summary>
                /// 设置请求环境参数
                /// </summary>
                /// <param name="environment">环境参数信息</param>
                /// <returns>monitorClient 构造器</returns>
                public Builder Environment(SDKEnvironment environment)
                {
                    monitorClient.environment = environment;
                    return this;
                }

                /// <summary>
                /// http 请求配置信息
                /// </summary>
                /// <param name="config">http 请求配置信息</param>
                /// <returns>monitorClient 构造器</returns>
                public Builder HttpRequestConfig(HttpRequestConfig config)
                {
                    monitorClient.httpRequestConfig = config;
                    return this;
                }
            }
    }
}
